package indzcraft.loader;

import java.util.Arrays;

public class Item
{ 	
	private int id;
	private String name = "";
	private String icon = "";
	private String tooltip = "";
	
	private int str;
	private int agi;
	private int sta;
	private int crit;
	private int haste;
	private int mastery;
	private int hit;
	private int exp;
	
	public String[] gemSlot = new String[3];
	public SocketBonus socketBonus = null;
	
	// weapon stats
	private int minDmg = 0;
	private int maxDmg = 0;
	private double speed = 0;
	private double dps = 0;
	
	// set
	private String set = "";
	private int inventorySlot = 0;		// slot
	private int inventoryType = 0;
	private int itemClass = 0;			// classs (Weapons, Armor)
	private int itemSubClass = 0;		// subclass (Thrown=16 Leather Armor = 2)
	private String gearBuff;
	private int numSockets;
	private int quality;
	private int itemLevel;
	private int heroic = 0;
	private int reqSkill;
	
	private double ep;
	
	
	public Item(){
		Arrays.fill(gemSlot, "");
	}
	public void setAgi(int agi){
		this.agi = agi;
	}
	public int getAgi(){
		return this.agi;
	}
	public void setSta(int sta){
		this.sta = sta;
	}
	public int getSta(){
		return this.sta;
	}
	public void setCrit(int crit) {
		this.crit = crit;
	}
	public int getCrit() {
		return crit;
	}
	public void setHaste(int haste) {
		this.haste = haste;
	}
	public int getHaste() {
		return haste;
	}
	public void setHit(int hit) {
		this.hit = hit;
	}
	public int getHit() {
		return hit;
	}
	public void setExp(int exp) {
		this.exp = exp;
	}
	public int getExp() {
		return exp;
	}
	public void setMastery(int mastery) {
		this.mastery = mastery;
	}
	public int getMastery() {
		return mastery;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getName(){
		return this.name;
	}
	public void setStr(int str) {
		this.str = str;
	}
	public int getStr() {
		return str;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getId() {
		return id;
	}
	public void setSet(String set) {
		this.set = set;
	}
	public String getSet(){
		return this.set;
	}
	public void setIcon(String icon) {
		this.icon = icon;
	}
	public String getIcon() {
		return icon;
	}
	public String[] getGemSlot(){
		return gemSlot;
	}
	public SocketBonus getSocketBonus(){
		return socketBonus;
	}
	
	public void print(){
		System.out.println("name: " + name);
		System.out.println("id: " + id);
		System.out.println("str: " + str);
		System.out.println("agi: " + agi);
		System.out.println("hit: " + hit);
		System.out.println("crit: " + crit);
		System.out.println("haste: " + haste);
		System.out.println("mastery: " + mastery);
		System.out.println("exp: " + exp);
		System.out.println("dps: " + dps);
		System.out.println("gems: " + gemSlot[0] + " " + gemSlot[1] + " " + gemSlot[2]);
		if(socketBonus != null)
			System.out.println("socketBonus: " + socketBonus.toString());
		System.out.println("set: " + set);
		System.out.println("gearBuff: " + gearBuff);
	}
	public void setInventoryType(int int1) {
		inventoryType = int1;
	}
	public int getInventoryType() {
		return inventoryType;
	}
	public void setInventorySlot(int int1) {
		inventorySlot = int1;
	}
	public int getInventorySlot() {
		return inventorySlot;
	}
	public void setItemSubClass(int itemSubClass) {
		this.itemSubClass = itemSubClass;
	}
	public int getItemSubClass() {
		return itemSubClass;
	}
	public void setGearBuff(String name2) {
		this.gearBuff = name2;
	}
	public String getGearBuff(){
		return gearBuff;
	}
	public void setNumSockets(int length) {
		this.numSockets = length;
	}
	public int getNumSockets(){
		return numSockets;
	}
	public void setSpeed(double s){
		speed = s;
	}
	public double getSpeed(){
		return speed;
	}
	public void setDps(double d){
		dps = d;
	}
	public double getDps(){
		return dps;
	}
	public void setMinDmg(int min){
		minDmg = min;
	}
	public int getMinDmg(){
		return minDmg;
	}
	public void setMaxDmg(int max){
		maxDmg = max;
	}
	public int getMaxDmg(){
		return maxDmg;
	}
	public void setQuality(int quality) {
		this.quality = quality;
	}
	public int getQuality() {
		return quality;
	}
	public void setItemLevel(int itemLevel) {
		this.itemLevel = itemLevel;
	}
	public int getItemLevel() {
		return itemLevel;
	}
	public void setHeroic(int heroic) {
		this.heroic = heroic;
	}
	public int getHeroic() {
		return heroic;
	}
	public String getWeaponTypeName(){
		String type = "";
		if(itemSubClass == 15){
			type = "dagger";
		}else if(itemSubClass == 4){
			type = "mace";
		}else if(itemSubClass == 7){
			type = "sword";
		}else if(itemSubClass == 0){
			type = "axe";
		}else if(itemSubClass == 13){
			type = "fist";
		}
		return type;
	}
	public void setItemClass(int itemClass) {
		this.itemClass = itemClass;
	}
	public int getItemClass() {
		return itemClass;
	}
	public void setTooltip(String tooltip) {
		this.tooltip = tooltip;
	}
	public String getTooltip() {
		return tooltip;
	}
	public void setReqSkill(int reqSkill) {
		this.reqSkill = reqSkill;
	}
	public int getReqSkill() {
		return reqSkill;
	}
	public String getStatString(){
		StringBuffer string = new StringBuffer();
		if(exp > 0)
			string.append("Exp, ");
		if(hit > 0)
			string.append("Hit, ");
		if(haste > 0)
			string.append("Haste, ");
		if(mastery > 0)
			string.append("Mastery, ");
		if(crit > 0)
			string.append("Crit, ");
		if(string.length() > 2){
			return string.substring(0, string.length()-2);
		}else
			return "";
	}
	public double getEp() {
		return ep;
	}
	public void setEp(double ep) {
		this.ep = ep;
	}
}
